import time
import os
from werkzeug.utils import secure_filename
def files_read(f1, f2):
    fileName = secure_filename(f1.filename)
    ext = fileName.rsplit('.', 1)[0]  # 获取文件后缀
    unix_time = int(time.time())
    new_filename = str(unix_time) + "." + ext
    upload_path = os.path.curdir + os.path.sep + 'static/' + 'upload/'
    file_url = upload_path + new_filename
    f1.save(os.path.join(upload_path, new_filename))
    #     第二个图像
    fileName2 = secure_filename(f2.filename)
    ext2 = fileName2.rsplit('.', 1)[0]  # 获取文件后缀
    unix_time2 = int(time.time())
    new_filename2 = str(unix_time2) + "." + ext2
    upload_path2 = os.path.curdir + os.path.sep + 'static/' + 'upload/'
    file_url2 = upload_path2 + new_filename2
    f2.save(os.path.join(upload_path2, new_filename2))
    return file_url, file_url2